/**
 * Created by Administrator on 2017/7/2.
 */

//全局搜索的js
define(['ngApp', 'ngHttp', 'jquery', 'ngConstant', 'ngAlert'], function (ngApp, ngHttp, JQ, ngConstant, ngAlert) {
    ngApp.controller("header", function ($scope, $http, $timeout, $rootScope, $state, $uibModal, commonFn, $cookies,$window) {



        //退出登录接口
        $scope.logOutBtn = function(){
            $http({
                url: ngConstant.interfaceHost + 'admin/infousers/logout',
                method: 'GET',
                headers: {'Authorization':$cookies.get("token")}
            }).then(function(res){
                ngAlert.successMsg(res.data.data);
                $cookies.remove('token');
                $timeout(function(){
                    $state.go('login');
                },2000);

            });
        };
    })
});


